package com.xzl.org.learning_situation_analysis.service.Impl;

import com.xzl.org.learning_situation_analysis.dao.PaperMapper;
import com.xzl.org.learning_situation_analysis.entity.Paper;
import com.xzl.org.learning_situation_analysis.service.PaperService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;

/**
 * @author 夏智力
 * @FileName PaperServiceImpl
 * @date 2022/4/12 21:37
 * @Software: IntelliJ IDEA
 */
@Service
public class PaperServiceImpl implements PaperService {

    @Autowired
    private PaperMapper paperMapper;
    @Override
    public int insertPaper(Paper paper) {
        paper.setReleaseTime(new Date(System.currentTimeMillis()));
        return paperMapper.insertPaper(paper);
    }

    @Override
    public Paper selectById(int id) {
        return paperMapper.selectById(id);
    }
}
